package base.exception;

/**
 * @Description: try catch finally
 * @Author: hmm
 * @CreateDate: 2019/8/6$ 23:32$
 * @UpdateUser: hmm
 * @UpdateDate: 2019/8/6$ 23:32$
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class TryCatchFinally {
    public static void main(String[] args) {
        int i = 1;
        try {
            System.out.println(i);
            new TryCatchFinally().excute(i);
            System.out.println("main继续执行" + i);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("main方法catch" + i);
        } finally {
            System.out.println("main方法finally" + i);
        }
    }

    private void excute(int i) {

        i = 2;
        i = i/0;
        /*try {*/
        //        } catch (Exception e) {
//            System.out.println("子方法异常");
//        }

    }
}
